import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/club_list_entity.dart';

ClubListEntity $ClubListEntityFromJson(Map<String, dynamic> json) {
  final ClubListEntity clubListEntity = ClubListEntity();
  final List<ClubListList>? list = (json['list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ClubListList>(e) as ClubListList).toList();
  if (list != null) {
    clubListEntity.list = list;
  }
  final int? page = jsonConvert.convert<int>(json['page']);
  if (page != null) {
    clubListEntity.page = page;
  }
  final int? pageSize = jsonConvert.convert<int>(json['pageSize']);
  if (pageSize != null) {
    clubListEntity.pageSize = pageSize;
  }
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    clubListEntity.total = total;
  }
  return clubListEntity;
}

Map<String, dynamic> $ClubListEntityToJson(ClubListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['page'] = entity.page;
  data['pageSize'] = entity.pageSize;
  data['total'] = entity.total;
  return data;
}

extension ClubListEntityExt on ClubListEntity {
  ClubListEntity copyWith({
    List<ClubListList>? list,
    int? page,
    int? pageSize,
    int? total,
  }) {
    return ClubListEntity()
      ..list = list ?? this.list
      ..page = page ?? this.page
      ..pageSize = pageSize ?? this.pageSize
      ..total = total ?? this.total;
  }
}

ClubListList $ClubListListFromJson(Map<String, dynamic> json) {
  final ClubListList clubListList = ClubListList();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    clubListList.id = id;
  }
  final int? gameType = jsonConvert.convert<int>(json['gameType']);
  if (gameType != null) {
    clubListList.gameType = gameType;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    clubListList.name = name;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    clubListList.avatar = avatar;
  }
  final String? featureTitle = jsonConvert.convert<String>(
      json['featureTitle']);
  if (featureTitle != null) {
    clubListList.featureTitle = featureTitle;
  }
  final String? featureContent = jsonConvert.convert<String>(
      json['featureContent']);
  if (featureContent != null) {
    clubListList.featureContent = featureContent;
  }
  final String? benefit = jsonConvert.convert<String>(json['benefit']);
  if (benefit != null) {
    clubListList.benefit = benefit;
  }
  final int? levelId = jsonConvert.convert<int>(json['levelId']);
  if (levelId != null) {
    clubListList.levelId = levelId;
  }
  final int? maxMember = jsonConvert.convert<int>(json['maxMember']);
  if (maxMember != null) {
    clubListList.maxMember = maxMember;
  }
  final int? totalMember = jsonConvert.convert<int>(json['totalMember']);
  if (totalMember != null) {
    clubListList.totalMember = totalMember;
  }
  final int? todayJoin = jsonConvert.convert<int>(json['todayJoin']);
  if (todayJoin != null) {
    clubListList.todayJoin = todayJoin;
  }
  final int? todayQuit = jsonConvert.convert<int>(json['todayQuit']);
  if (todayQuit != null) {
    clubListList.todayQuit = todayQuit;
  }
  final int? todayActive = jsonConvert.convert<int>(json['todayActive']);
  if (todayActive != null) {
    clubListList.todayActive = todayActive;
  }
  final String? introduce = jsonConvert.convert<String>(json['introduce']);
  if (introduce != null) {
    clubListList.introduce = introduce;
  }
  final String? applyingReason = jsonConvert.convert<String>(
      json['applyingReason']);
  if (applyingReason != null) {
    clubListList.applyingReason = applyingReason;
  }
  final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
  if (createdAt != null) {
    clubListList.createdAt = createdAt;
  }
  final int? applyTime = jsonConvert.convert<int>(json['applyTime']);
  if (applyTime != null) {
    clubListList.applyTime = applyTime;
  }
  final int? state = jsonConvert.convert<int>(json['state']);
  if (state != null) {
    clubListList.state = state;
  }
  final String? auditReason = jsonConvert.convert<String>(json['auditReason']);
  if (auditReason != null) {
    clubListList.auditReason = auditReason;
  }
  final int? auditTime = jsonConvert.convert<int>(json['auditTime']);
  if (auditTime != null) {
    clubListList.auditTime = auditTime;
  }
  final String? createUserId = jsonConvert.convert<String>(
      json['createUserId']);
  if (createUserId != null) {
    clubListList.createUserId = createUserId;
  }
  final String? ownerId = jsonConvert.convert<String>(json['ownerId']);
  if (ownerId != null) {
    clubListList.ownerId = ownerId;
  }
  final int? join = jsonConvert.convert<int>(json['join']);
  if (join != null) {
    clubListList.join = join;
  }
  final int? memberLevel = jsonConvert.convert<int>(json['memberLevel']);
  if (memberLevel != null) {
    clubListList.memberLevel = memberLevel;
  }
  final int? sort = jsonConvert.convert<int>(json['sort']);
  if (sort != null) {
    clubListList.sort = sort;
  }
  return clubListList;
}

Map<String, dynamic> $ClubListListToJson(ClubListList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['gameType'] = entity.gameType;
  data['name'] = entity.name;
  data['avatar'] = entity.avatar;
  data['featureTitle'] = entity.featureTitle;
  data['featureContent'] = entity.featureContent;
  data['benefit'] = entity.benefit;
  data['levelId'] = entity.levelId;
  data['maxMember'] = entity.maxMember;
  data['totalMember'] = entity.totalMember;
  data['todayJoin'] = entity.todayJoin;
  data['todayQuit'] = entity.todayQuit;
  data['todayActive'] = entity.todayActive;
  data['introduce'] = entity.introduce;
  data['applyingReason'] = entity.applyingReason;
  data['createdAt'] = entity.createdAt;
  data['applyTime'] = entity.applyTime;
  data['state'] = entity.state;
  data['auditReason'] = entity.auditReason;
  data['auditTime'] = entity.auditTime;
  data['createUserId'] = entity.createUserId;
  data['ownerId'] = entity.ownerId;
  data['join'] = entity.join;
  data['memberLevel'] = entity.memberLevel;
  data['sort'] = entity.sort;
  return data;
}

extension ClubListListExt on ClubListList {
  ClubListList copyWith({
    String? id,
    int? gameType,
    String? name,
    String? avatar,
    String? featureTitle,
    String? featureContent,
    String? benefit,
    int? levelId,
    int? maxMember,
    int? totalMember,
    int? todayJoin,
    int? todayQuit,
    int? todayActive,
    String? introduce,
    String? applyingReason,
    int? createdAt,
    int? applyTime,
    int? state,
    String? auditReason,
    int? auditTime,
    String? createUserId,
    String? ownerId,
    int? join,
    int? memberLevel,
    int? sort,
  }) {
    return ClubListList()
      ..id = id ?? this.id
      ..gameType = gameType ?? this.gameType
      ..name = name ?? this.name
      ..avatar = avatar ?? this.avatar
      ..featureTitle = featureTitle ?? this.featureTitle
      ..featureContent = featureContent ?? this.featureContent
      ..benefit = benefit ?? this.benefit
      ..levelId = levelId ?? this.levelId
      ..maxMember = maxMember ?? this.maxMember
      ..totalMember = totalMember ?? this.totalMember
      ..todayJoin = todayJoin ?? this.todayJoin
      ..todayQuit = todayQuit ?? this.todayQuit
      ..todayActive = todayActive ?? this.todayActive
      ..introduce = introduce ?? this.introduce
      ..applyingReason = applyingReason ?? this.applyingReason
      ..createdAt = createdAt ?? this.createdAt
      ..applyTime = applyTime ?? this.applyTime
      ..state = state ?? this.state
      ..auditReason = auditReason ?? this.auditReason
      ..auditTime = auditTime ?? this.auditTime
      ..createUserId = createUserId ?? this.createUserId
      ..ownerId = ownerId ?? this.ownerId
      ..join = join ?? this.join
      ..memberLevel = memberLevel ?? this.memberLevel
      ..sort = sort ?? this.sort;
  }
}